package com.xuecheng.order.config;


import cn.hutool.db.sql.Order;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.xuecheng.order.domain.OrderData;
import com.xuecheng.order.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

import static io.netty.handler.codec.smtp.SmtpRequests.data;


@Component
public class EasyexcelTemplate {

    public  void upload(List<OrderData> list ,String fileName) {

        // 调用方法实现写操作
        EasyExcel.write(fileName, OrderData.class)
                .sheet()
                .doWrite(list);
    }
}
